<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>04_对象扩展</title>
</head>
<body>
<!--
1. Object.is(v1, v2)
  * 判断2个数据是否完全相等
  
2. Object.assign(target, source1, source2..)
  * 将源对象的属性复制到目标对象上
  
3. 直接操作 __proto__ 属性
  let obj2 = {};
  obj2.__proto__ = obj1;

  Object.setPrototypeOf()：设置对象的原型对象
  Object.getPrototypeOf()：返回对象的原型对象
-->

<script type="text/javascript">
	console.log(0==-0);//true
	console.log(Object.is(0, -0));//false
	console.log(NaN==NaN);//false
	console.log(Object.is(NaN, NaN));//true
	console.log(Object.is('abc', 'abc'));//true
 

    //Object.assign(target, source1, source2..)
    let obj1 = {name : 'kobe', age : 39}
    let obj2 = {sex : '男'}
    let obj = {}
    // Object.assign(obj, obj1, obj2);
	obj={...obj1,...obj2}
    console.log(obj);//{name: "kobe", age: 39, sex: "男"}
	

    //直接操作 __proto__ 属性
    let obj3 = {name : 'anverson', age : 41};
    let obj4 = {};
    obj4.__proto__ = obj3;
    console.log(obj4);
</script>
</body>

</html>